# 精灵类的派生飞机模块
# 模块继承自pygame.sprite.Sprite类
import pygame


class player(pygame.sprite.Sprite):
    """
    玩家类
    属性: image rect speed bullet_type
    方法: init update fire
    """

    def __init__(self, image_path, speed=1) -> None:
        super().__init__()

        # 定义对象属性
        self.image = pygame.image.load(image_path)
        self.speed = speed
        self.rect = self.image.get_rect()

    def update(self) -> None:
        self.rect.y += self.speed  # 垂直方向移动
